/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2023-09-09 15:26:50
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2023-09-09 16:41:41
 * @FilePath: \learn2\cmd\day01\test\mystruct.go
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package test

import "fmt"

type Data struct {
	A string `json:"a"`
	B string `json:"b"`
}

type Info struct {
	C string `json:"c"`
	D int    `json:"d"`
}

type Person struct {
	Name string `json:"name"`
	City string `json:"city"`
	age  int8   `json:"age"`
	Data Data   `json:"data"`
	Info struct {
		C string `json:"c"`
		D int    `json:"d"`
	} `json:"info"`
}

func (p *Person) SetAge(age int8) {
	p.age = age
}

func (p *Person) GetAge() int8 {
	return p.age
}

func (p *Person) ShowUserInfo() string {
	info := fmt.Sprintf("name = %s, city = %s, age = %d", p.Name, p.City, p.age)
	fmt.Println(info)

	return info
}

type person struct {
	name string
	city string
	age  int8
}

type PersonPro struct {
	*Person
	Nickname string `json:"nick_name"`
}
